use std::mem;
//
fn analysis(slice: &[i32]) {
    println!("len={}", slice.len());
    println!("{}", slice[0]);
}
//

//
fn main() {
    // [类型; 长度]
    let xs: [i32; 5] = [1, 2, 3, 4, 5];
    analysis(&xs);
    //[val; 长度]
    let ys = [3; 5];
    analysis(&ys);
    
    let size = mem::size_of_val(&xs);
    println!("size_of_val={}", size);

    analysis(&xs[1..4]);
}
